{include file="header.html"}
<style>
.formbtn1 {
    display: inline-block !important;
    height: 32px !important;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: 0;
    background-image: none;
    background-color: #fff;
    font-size: 14px;
    font-weight: 400;
    line-height: 30px;
    color: #1a1a1a;
    text-align: center;
    vertical-align: top;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -o-box-sizing: border-box;
    background-color: #0ae;
    border-color: #0ae;
    color: #fff;
    text-shadow: none;
}
.formbtn1:hover{
	color: #fff;
}
</style>
<script type="text/javascript">
//<!CDATA[
$(function(){
	 $("[id^='pc_']").live('click',function(){
			var id=$(this).attr("item");
			var oid=$(this).attr("oitem");
			$w=$(window).width();
	        $h=$(window).height();
	        $w=$w*0.7;
	        src="index.php?app=datarefer&act=choose&wid={$waybill.wm_tid}"
	        $("#pcframe").attr("src","index.php?app=quicktrain&act=choose&wid="+id+"&oper="+oid);
	    	$("#pcframe").width($w);
	        $.colorbox({
	            width : $w+20,
	            height : "650px",
	            inline : true,
	            href : "#pcframe"
	        });
	});
	 
	 
	 $("#btnsubmit").click(function() {
			if (confirm('确定发车吗')) {

				var can = true;
				var item = 0;
				$("[id^='cnum_']").each(function() {
					if (!this.checked) {
						return true;
					}
					var i = $(this).attr('item');
					item++;
					var v = $("#sj_" + i).val();
					if(v==0){
						can = false;
						alert("请选择司机后再发车");
						return false;
					}
				});

				if (item <= 0) {
					alert("请选择运单");
					return false;
				}

				if (can) {
					$("#acategory_form").submit();
				}
			}
		});
  
    $("#search").click(function(){
    	$("#act").val("index");

    	$("#form1").submit();
    });
});
function change(uid,name,wmid){
	$.colorbox.close();
	$("#pc_"+wmid).val(name);
	$("#sj_"+wmid).val(uid);
}
//]]>
</script>

<div style="display: none"  >
	<div id="pclist">
	<iframe id="pcframe"  width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>

<div id="rightTop">
	<p>快捷发车</p>
	<ul class="subnav">
		<li><span>管理</span>
		</li>
	</ul>
</div>
<div class="mrightTop">
	<div class="fontl">
		<form method="get">
			<div class="left">

                    <input type="hidden" name="app" value="quicktrain" />
                <input type="hidden" name="act" value="index" />
  运单类型:
                <select class="querySelect" id="type_id" name="type_id">
                <option value="">{$lang.select_pls}</option>
                {html_options options=$types selected=$smarty.get.type_id}
                </select>
             运单状态:
                <select class="querySelect" id="status" name="status">
                <option value="">{$lang.select_pls}</option>
                {html_options options=$status selected=$smarty.get.status}
                </select>
                <input type="submit" class="formbtn" value="{$lang.query}" />
          
           
                   <input class="formbtn1" type="button"
						value="快捷发车" name="id" id="btnsubmit" />
                  
                  
			</div>
		</form>
	</div>
	<div class="fontr">{include file=page.top.html}</div>
	<div class="clear:both;"></div>
</div>
<div class="tdare">

<form method="post" enctype="multipart/form-data" id="acategory_form"
		action="index.php?app=quicktrain&amp;act=alltrain">

	<table width="100%" cellspacing="0" class="dataTable">
		<!--{if $waybill}-->
		<tr class="tatr1">
			<td width="20" class="firstCell"><input type="checkbox"
				class="checkall"  />
			</td>
			<td align="left">运单号</td>
			<td align="left">装货时间 / 卸货时间</td>
			<td align="left">起点</td>
			<td align="left">终点</td>
			<td align="left">箱型</td>
			<td align="left">箱量</td>
			<td style="width: 200px">司机</td>
		</tr>
		<!--{/if}-->
		<!--{foreach from=$waybill item=w}-->
		<tr class="tatr2">
		    <td class="firstCell"> <input  name="cnum[{$w.wm_tid}]" id="cnum_{$g.gs_tid}" item="{$w.wm_tid}"
		     type="checkbox" class="checkitem" value="{$w.wm_tid}"/></td>
			<td width="15%;">{$w.wm_code|escape}</td>
			
			<td width="25%;">{if $w.wm_type=='集港'}
			{if $w.g_collectiontime}{$w.g_collectiontime|date:Y-m-d H:i}{else}-{/if} / {if $w.g_collectiontime}{$w.g_packingtime|date:Y-m-d H:i}{else}-{/if}
			{else}
			{if $w.g_collectiontime}{$w.g_packingtime|date:Y-m-d H:i}{else}-{/if} / {if $w.g_collectiontime}{$w.g_collectiontime|date:Y-m-d H:i}{else}-{/if}
			{/if}
			</td>
			
			<td>{if $w.wm_type=='集港'}{$w.g_loading_place|escape}{else}{$w.g_full_container_depot|escape}{/if}</td>
			<td>{if $w.wm_type=='疏港'}{$w.g_loading_place|escape}{else}{$w.g_full_container_depot|escape}{/if}</td>
			<td>{$w.g_box|escape}</td>
			<td>{$w.ws_volume|escape}</td>
			
			<td style="display: none;"><input name="sj[{$w.wm_tid}]" type="text" class=""
					value="{$w.wm_user}"  id="sj_{$w.wm_tid}"
					item="{$w.wm_tid}" />
				</td>
				
				<td style="display: none;"><input name="op[{$w.wm_tid}]" type="text" class=""
					value="{$w.wm_carrier_id}"  id="op_{$w.wm_tid}"
					item="{$w.wm_tid}" />
				</td>
			
			<td><input class="queryInput" value="{$w.sname}" type="text" id="pc_{$w.wm_tid}" oitem="{$w.wm_carrier_id}" item="{$w.wm_tid}" readonly="readonly"  placeholder="请选择司机"/></td>
			
		</tr>
		<!--{foreachelse}-->
		<tr class="no_data">
			<td colspan="9">{$lang.no_data}</td>
		</tr>
		<!--{/foreach}-->
	</table>
	<!--{if $waybill}-->
	<div id="dataFuncs">
		<div class="pageLinks">{include file=page.bottom.html}</div>
		<div class="clear:both;"></div>
	</div>
	<div class="clear"></div>
	<!--{/if}-->
	</form>
</div>
{include file="footer.html"}
